home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14286 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  45 lines

  1. Path: ix.netcom.com!news
  2. From: jlilley@ix.netcom.com (John Lilley)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: what's incomplete type?
  5. Date: 29 Mar 1996 16:17:14 GMT
  6. Organization: Netcom
  7. Message-ID: <4jh2ea$scq@dfw-ixnews6.ix.netcom.com>
  8. References: <4jce8i$7ge@geraldo.cc.utexas.edu>
  9. NNTP-Posting-Host: den-co11-03.ix.netcom.com
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-NETCOM-Date: Fri Mar 29 10:17:14 AM CST 1996
  13. X-Newsreader: WinVN 0.99.7
  14.  
  15. >Could anyone please tell me exactly exactly it means by "incomplete
  16. >type"? What's the possible reason for this "incomplete type"?
  17.  
  18. An incomplete type is usually a class/struct that has been
  19. named, but which has not been defined in the current scope.
  20.  
  21. For example:
  22.  
  23. class A;
  24.  
  25. void foo() {
  26.    A a;     // error: incomplete type
  27.    A* a;    // OK: pointer to incomplete type
  28.  
  29.    // If you try to look at *A in the debugger, it *may*
  30.    // claim that *a is incomplete
  31. }
  32.  
  33. class A{...};
  34.  
  35. void bar() {
  36.    A a;    // OK: complete type
  37. }
  38.  
  39.  
  40. However, it sounds like your debugger is a little confused, since
  41. *this ought to always be a complete type inside a member function.
  42.  
  43. john lilley
  44.  
  45.